Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v12: Add support for ImageSharp 2 #57

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

ronaldbarendse
Copy link
Contributor

Umbraco 12 uses ImageSharp 3 by default, but also provides an Umbraco.Cms.Imaging.ImageSharp2 package if you can't use this version and want to stick to ImageSharp 2, e.g. because of the license change or other dependencies (see PRs umbraco/Umbraco-CMS#14216 and umbraco/Umbraco-CMS#14223).

This package can be installed instead of Umbraco.Cms.Imaging.ImageSharp (that will be kept up to date with the latest ImageSharp version) by switching from Umbraco.Cms (that bundles all default/optional dependencies) to Umbraco.Cms.Targets and including any other required dependencies yourself.

We initially released Umbraco.StorageProviders 12 RC versions that had direct dependencies on the ImageSharp 2 packages and let the transitive dependency resolution pick the lowest compatible version. This however resulted in always using SixLabors.ImageSharp.Web.Providers.Azure v2, even when used together with SixLabors.ImageSharp.Web v3. This currently isn't an issue because of the lack of an upper version limit, but could be in a future update, besides always resolving to the lowest compatible version and not taking advantage of the latest v3 updates. However, we also failed to notice that Umbraco.StorageProviders.AzureBlob.ImageSharp had a direct dependency on Umbraco.Cms.Imaging.ImageSharp, which makes the dependency on ImageSharp require version 3 and thereby prevents you to use this package with v2 altogether 🙁

For the final v12 version, I bumped the ImageSharp dependency to the latest v3, resulting in not being able to use this package with v2... This PR adds that support by introducing a new Umbraco.StorageProviders.AzureBlob.ImageSharp2 package that you can install:

<Project Sdk="Microsoft.NET.Sdk.Web">
	<!-- Default CMS install using ImageSharp 3 -->
	<ItemGroup>
		<PackageReference Include="Umbraco.Cms" Version="12.0.0" />
		<PackageReference Include="Umbraco.StorageProviders.AzureBlob.ImageSharp" Version="12.0.0" />
	</ItemGroup>
	
	<!-- Custom CMS install using ImageSharp 2 -->
	<ItemGroup>
		<PackageReference Include="Umbraco.Cms.Targets" Version="12.0.0" />
		<PackageReference Include="Umbraco.Cms.Imaging.ImageSharp2" Version="12.0.0" />
		<PackageReference Include="Umbraco.Cms.Persistence.Sqlite" Version="12.0.0" />
		<PackageReference Include="Umbraco.Cms.Persistence.SqlServer" Version="12.0.0" />
		<PackageReference Include="Umbraco.Cms.Persistence.EFCore" Version="12.0.0" />
		<PackageReference Include="Umbraco.StorageProviders.AzureBlob.ImageSharp2" Version="12.*" />
	</ItemGroup>
</Project>

@ronaldbarendse
Copy link
Contributor Author

One downside to having different packages to support ImageSharp 2 or 3, is that the Umbraco Cloud setup package will need to depend on different ones as well. We will need to consider this if we want to ensure both packages are included in automatic upgrades, but that's probably already the case when changing the package reference from Umbraco.Cms to Umbraco.Cms.Targets (and all default/optional dependencies)...

@ronaldbarendse ronaldbarendse added the enhancement New feature or request label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant